import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'

const path = require('path')

export default defineConfig(({
  command,
  mode
}) => {
  const env = loadEnv(mode, process.cwd())
  console.log('环境变量---', env)
  return {
    plugins: [vue()],
    resolve: {
      // 设置引用路径别名
      alias: {
        '@': path.resolve(__dirname, './src')
      },
      // 设置省略引用文件类型
      extensions: ['.vue', '.js', '.less', '.css']
    }
  }
})
